package tech.lq0.dreamaticdelight.item.food.hifumi;

import net.minecraft.ChatFormatting;
import net.minecraft.network.chat.Component;
import net.minecraft.world.effect.MobEffectInstance;
import net.minecraft.world.effect.MobEffects;
import net.minecraft.world.food.FoodProperties;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.TooltipFlag;
import net.minecraft.world.level.Level;
import org.jetbrains.annotations.Nullable;
import tech.lq0.dreamaticvoyage.tools.Livers;
import tech.lq0.dreamaticvoyage.tools.TooltipTool;
import vectorwing.farmersdelight.common.item.ConsumableItem;

import java.util.List;

public class MeiyaCake extends ConsumableItem {

    private static final FoodProperties FOOD = (new FoodProperties.Builder()).nutrition(5).saturationMod(0.4F)
            .effect(() -> new MobEffectInstance(MobEffects.CONFUSION, 600, 0), 1.0F)
            .effect(() -> new MobEffectInstance(MobEffects.WITHER, 600, 0), 1.0F)
            .build();

    public MeiyaCake() {
        super(new Properties().food(FOOD), true);
    }

    @Override
    public void appendHoverText(ItemStack stack, @Nullable Level level, List<Component> tooltip, TooltipFlag isAdvanced) {
        tooltip.add(Component.translatable("des.dreamaticdelight.meiya_cake").withStyle(ChatFormatting.GRAY));
        super.appendHoverText(stack, level, tooltip, isAdvanced);
        TooltipTool.addLiverInfo(tooltip, Livers.HIFUMI);
    }

}
